package com.hzncc.flowable_diboot.contract.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;
import com.diboot.core.entity.BaseModel;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import jakarta.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
* 销售合同 Entity 定义
* @author MyName
* @version 1.0
* @date 2024-09-09
* Copyright © MyCorp
*/

@TableName("mdl_sales_contract")
@Getter @Setter @Accessors(chain = true)
public class SalesContract extends BaseModel {
    private static final long serialVersionUID = 1502914028631642574L;

    /**
     * 租户
     */
    @NotNull(message = "租户不能为空")
    @TableField()
    private String tenantId;

    /**
     * 采购订单编号
     */
    @Length(max=100, message="采购订单编号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String orderCode;

    /**
     * 售达方
     */
    @Length(max=100, message="售达方长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String soldToParty;

    /**
     * 售达方SAP编号
     */
    @Length(max=100, message="售达方SAP编号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String soldToPartySapCode;

    /**
     * 送达方
     */
    @Length(max=100, message="送达方长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String recipient;

    /**
     * 送达方SAP编号
     */
    @Length(max=100, message="送达方SAP编号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String recipientSapCode;

    /**
     * 业务板块
     */
    @TableField()
    private String businessModel;

    /**
     * 业务部门
     */
    @Length(max=100, message="业务部门长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String businessDept;

    /**
     * 凭证日期
     */
    @TableField()
    private LocalDate documentDate;

    /**
     * 销售区域
     */
    @TableField()
    private String salesTerritory;

    /**
     * 合同附件文本
     */
    @Length(max=100, message="合同附件文本长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String textOfAttachment;

    /**
     * 订购项目
     */
    @Length(max=100, message="订购项目长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String orderItem;

    /**
     * 订购型号
     */
    @Length(max=100, message="订购型号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String orderModel;

    /**
     * 订购数量
     */
    @Length(max=100, message="订购数量长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String orderQuantity;

    /**
     * 系统通道
     */
    @TableField()
    private String systemChannel;

    /**
     * 交（提）货时间
     */
    @TableField()
    private String deliveryTime;

    /**
     * 质量条件
     */
    @TableField()
    private String qualityCondition;

    /**
     * 产品性质
     */
    @TableField()
    private String productNature;

    /**
     * 付款方式
     */
    @TableField()
    private String paymentMethod;

    /**
     * 销售雇员
     */
    @Length(max=100, message="销售雇员长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String salesEmployee;

    /**
     * 销售雇员工号
     */
    @Length(max=100, message="销售雇员工号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String salesEmployeeNumber;

    /**
     * 销售组织
     */
    @Length(max=100, message="销售组织长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String salesOrganization;

    /**
     * 分销渠道
     */
    @TableField()
    private String distributionChannel;

    /**
     * 产品组
     */
    @TableField()
    private String productGroup;

    /**
     * 固定折扣价金额
     */
    @Length(max=100, message="固定折扣价金额长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String fixedDiscountAmount;

    /**
     * 已收款金额
     */
    @Length(max=100, message="已收款金额长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String amountReceived;

    /**
     * 未收款金额
     */
    @Length(max=100, message="未收款金额长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String amountNotReceived;

    /**
     * 发货情况
     */
    @TableField()
    private String deliveryStatus;

    /**
     * 开票情况
     */
    @TableField()
    private String invoiceStatus;

    /**
     * 收款情况
     */
    @TableField()
    private String paymentStatus;

    /**
     * 是否取消
     */
    @TableField()
    private Boolean isCancel;

    /**
     * 失败原因
     */
    @Length(max=100, message="失败原因长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String failureCause;

    /**
     * 推送状态 1 成功 2 失败
     */
    @TableField()
    private Integer pushStatus;

    /**
     * SAP编码
     */
    @Length(max=100, message="SAP编码长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String sapCode;

    /**
     * 合同产品ID
     */
    @TableField
    private String contractProductId;

    /**
     * 合同类型
     */
    @TableField
    private String contractType;

    /**
     * 开票日期
     */
    @TableField
    private LocalDateTime orderDate;


    /**
     * 项目合同id
     */
    @Length(max=32, message="项目合同id长度应小于32")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String projectContractId;
}